package edu.scu.declaresys.web.util;

import java.util.Map;

import edu.scu.declaresys.vo.User;

/**
 * 
 * @author: zt
 * @since : 2013-7-10
 */
public class SessionUtil
{
	public static User getCurrentUser(Map<String, Object> session)
	{
		return (User)session.get(User.T_TABLE);
	}
	
	public static boolean isLogin(Map<String, Object> session)
	{
		return getCurrentUser(session) != null;
	}
	
	public static Integer getCrtUserId(Map<String, Object> session)
	{
		User user = getCurrentUser(session);
		if(user == null)
		{
			return null;
		}
		return user.getId();
	}
}
